package com.open.capacity.common.util.skf;

import com.sun.jna.Structure;

import java.util.Arrays;
import java.util.List;

public class Struct_RSAPUBLICKEYBLOB extends Structure {
    /*
 //RSA公钥交换数据块
typedef struct Struct_RSAPUBLICKEYBLOB{
	ULONG	AlgID;									//算法标识号
	ULONG	BitLen;									//模数的实际位长度，必须是8的倍数
	BYTE	Modulus[MAX_RSA_MODULUS_LEN];			//模数n=p*q，实际长度为BitLen/8字节
	BYTE	PublicExponent[MAX_RSA_EXPONENT_LEN];	//公开密钥e， 一般为00010001
} RSAPUBLICKEYBLOB, *PRSAPUBLICKEYBLOB;
  */
    public Long AlgID;
    public Long BitLen;
    public byte[] Modulus = new byte[256];
    public byte[] PublicExponent = new byte[4];

    public static class ByReference extends Struct_RSAPUBLICKEYBLOB implements Structure.ByReference {
    }

    public static class ByValue extends Struct_RSAPUBLICKEYBLOB implements Structure.ByValue {
    }

    public Long get_AlgID() {
        return AlgID;
    }

    public Long get_BitLen() {
        return BitLen;
    }

    @Override
    protected List getFieldOrder() {
        return Arrays.asList(new String[]{"AlgID", "BitLen", "Modulus", "PublicExponent"});
    }


}
